package com.mini.framework.web.handler;

import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpServletResponse;

import com.mini.framework.web.ViewHandler;

public class JspViewHandler implements ViewHandler {
	
	private String viewPath;
	
	
	
	public JspViewHandler(String viewPath){
		this.viewPath = viewPath;
	}

	@Override
	public void render(HttpServletRequest request, HttpServletResponse response,Object view) {
		try{
			request.getRequestDispatcher(viewPath + view.toString()).forward(request, response);
		}catch(Exception e){
			e.printStackTrace();
		}
		
	}

}
